<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://java.sun.com/jsf/composite/org.richfaces.showcase">
	<h:head>
		<!-- <link href="./css/styles.css" rel="stylesheet" type="text/css" /> -->
	    <link rel="stylesheet" href="./css/treeview/screen.css" type="text/css" />
        <link rel="stylesheet" href="./css/treeview/jquery.treeview.css" type="text/css" />
        <link rel="stylesheet" href="css/themes/redmond/jquery.ui.all.css" />
		<!--  <script language="javascript" src="./js/common.js"></script>-->
		<!-- <script language="javascript" src="./js/jquery-1.4.2.min.js"></script>  -->  
		<script language="javascript" src="./js/treeview/jquery.treeview.js"></script>
		<script language="javascript" src="./js/contextmenu/jquery.contextmenu.r2.js"></script>
		<script type="text/javascript" src="./js/ui/jquery.ui.tabs.js"></script>
		<script src="./js/ui/jquery.ui.dialog.js"></script>

		<script>
  			$(document).ready(function(){
    			$("#example").treeview();
  			});
  			
  	     $(document).ready(function() {
 
           $('span.demo1').contextMenu('myMenu1', {
        bindings: {
 
          'new': function(t) {
            window.location.href="addClassify.jsf";
 
          },
 
          'refresh': function(t) {
          
           window.location.reload();
 
          },
 
          'opera': function(t) {
 
            window.location.href="ShowTreeMenu.jsf?id=0";
 
          },
 
          'delete': function(t) {
 
            alert('Trigger was '+t.id+'\nAction was Delete');
 
          }
 
        }
 
      });	
		
	});

  </script>
	</h:head>
	
	<h:body>
	
	<f:view>
	 <h:form>
		<rich:panel style="width:200px">
			<f:facet name="header">
				<h:outputText value="题录" />
			</f:facet>
		
			<ul id="example" class="filetree">
		   		<a4j:repeat value="#{navigatorMenu.treeNode}" var="gr">
					<li><span class="folder demo1"><h:outputText value="#{gr.root.nodename}" /> </span>   
			     		<ul>
			        		<a4j:repeat value="#{gr.child}" var="ch" rendered="#{gr.size != 0}">
				         		<li><span class="folder"><h:outputText value="#{ch.root.nodename}" ></h:outputText></span>				          
						      	<ul>
						          <a4j:repeat value="#{ch.child}" var="ch1" rendered="#{ch.size != 0}">
							           <li><span class="folder">
									         <h:outputLink value="ShowDate.jsf">
        									     <h:outputText value="#{ch1.root.nodename}"></h:outputText>
        									     <f:param value="#{ch1.root.nodeid}" name="id"></f:param>
        							         </h:outputLink>
								           </span>
							          </li>
							       </a4j:repeat>	
						        </ul>						         			
				        		</li>
				      		</a4j:repeat>
			      		</ul>		    
		   		     </li>	
		        </a4j:repeat>
           </ul>
		
  <div class="contextMenu" id="myMenu1"> 
 
    <ul> 
 
      <li id="new"><img src="images/icons/file.png" /> 新建</li> 
 
      <li id="opera"><img src="images/icons/save.gif" /> 操作</li> 
 
      <li id="refresh"><img src="images/icons/reload.gif" /> Refresh</li>
      
      <li id="delete"><img src="images/icons/delete.gif" /> Delete</li>  
 
    </ul> 
 
  </div> 
	</rich:panel>
	</h:form>
	
	
	
			</f:view>
			</h:body>
</ui:composition>
